package com.sc.nft.dto;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.sc.nft.annotation.MetagoBackupDS;
import com.sc.nft.entity.UserEcologyPointsDetail;
import com.sc.nft.entity.vo.ecology.AdminEcologyPointsUserPageDetailsVO;
import com.sc.nft.mapper.UserEcologyPointsDetailMapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.util.Date;

/**
 * 生态-积分收入支出明细(sc_user_ecology_points_detail)数据DAO
 *
 * @author Sun
 * @description 由 Mybatisplus Code Generator 创建
 * @since 2023-10-13 17:21:48
 */
@Slf4j
@Repository
@RequiredArgsConstructor
public class UserEcologyPointsDetailDao /* extends ServiceImpl<UserEcologyPointsDetailMapper, UserEcologyPointsDetail> */ {

    private final UserEcologyPointsDetailMapper baseMapper;

    @MetagoBackupDS
    public Page<AdminEcologyPointsUserPageDetailsVO> getUserDetailsPage(Page<?> page, Long userId, Integer type, Date startTime, Date endTime) {
        return baseMapper.getUserDetailsPage(page, userId, type, startTime, endTime);
    }

    public Boolean save(UserEcologyPointsDetail entity) {
        return SqlHelper.retBool(baseMapper.insert(entity));
    }

}